<template>
  <div
    class="search-item-wrapper"
    @click="onClick"
  >
    <div class="search-item-icon">
      <div class="icon-wrapper">
        <van-icon
          :name="icon"
          color="rgba(#000000 50%)"
          size="26px"
          :style="{ width:'26px' , height:'26px' }"
        ></van-icon>
      </div>
    </div>
    <div class="search-item-info">
      <div class="search-item-title">{{title}}</div>
      <div class="search-item-sub-title">{{subTitle}}</div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    title: String,
    subTitle: String,
    icon: String
  },
  methods: {
    onClick () {
      console.log('searchitem-onClick')
      this.$emit('onClick')
    }
  }

}
</script>

<style lang="scss" scoped>
.search-item-wrapper {
  margin: 20px 0 0 20px;
  height: 37px;
  display: flex;
  align-items: center;

  .search-item-icon {
    .icon-wrapper {
      background: #f7f7f9;
      display: flex;
      justify-content: center;
      align-items: center;
      border-radius: 50%;
      width: 26px;
      height: 26px;
    }
  }
  .search-item-info {
    padding-left: 15px;
    .search-item-title {
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      font-size: 18px;
      color: #333333;
      line-height: 22px;
    }
    .search-item-sub-title {
      font-size: 16px;
      color: rgba(0, 0, 0, 0.45);
      line-height: 17px;
    }
  }
}
</style>